package com.cc.moxingvoice.lock;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.cc.moxingvoice.R;
import com.cc.moxingvoice.base.BaseLock;
import com.cc.moxingvoice.databinding.FragmentMineBinding;
import com.cc.moxingvoice.ui.other.AboutActivity;
import com.cc.moxingvoice.ui.other.DonationActivity;
import com.cc.moxingvoice.utils.CheckUpdateUtil;
import com.cc.moxingvoice.utils.ShareUtil;
import com.cc.moxingvoice.widget.dialog.ButtonTwoDialog;

import java.util.HashMap;

import cn.smssdk.EventHandler;
import cn.smssdk.SMSSDK;
import cn.smssdk.gui.RegisterPage;

/**
 * 创建日期：2018/3/25 on 15:07
 * 描述：
 * 作者：郭士超
 * QQ：1169380200
 */

public class MineLock extends BaseLock<FragmentMineBinding> {

    public MineLock(Context context, FragmentMineBinding binding) {
        super(context, binding);
    }

    public MineLock(Context context, FragmentMineBinding binding, Bundle bundle) {
        super(context, binding, bundle);
    }

    @Override
    protected void init() {

    }

    /**
     * 更新
     *
     * @param view
     */
    public void update(View view) {
        CheckUpdateUtil.checkUpdate(getContext(), true);
    }

    /**
     * 分享
     *
     * @param view
     */
    public void share(View view) {
        new ButtonTwoDialog(mContext, R.style.dialog, mContext.getString(R.string.hope_to_share), new ButtonTwoDialog.OnCloseListener() {
            @Override
            public void onClick(Dialog dialog, boolean confirm) {
                ShareUtil.showShare(getContext());
                dialog.dismiss();
            }
        }).show();
    }

    /**
     * 教程
     *
     * @param view
     */
    public void teach(View view) {
        startActivity(AboutActivity.class);
    }

    /**
     * 捐赠
     *
     * @param view
     */
    public void donation(View view) {
        startActivity(DonationActivity.class);
    }

}
